package com.example.zqm.git72.Model;
import com.example.zqm.git72.Service.ClubService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
 * Created by Administrator on 2017/4/26.
 */
public class ClubModel {
    private Retrofit retrofit;
    public ClubModel(){
        //联网获取网络上的数据
         retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call getList()
    {
        ClubService clubService=retrofit.create(ClubService.class);
        return clubService.getList();
    }
  public  Call getClubById(String id)
{

    ClubService clubService = retrofit.create(ClubService.class);
    return  clubService.getClubById(id);

}
    public  Call getTypeList(String id, String type)
    {
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getTypeList(id, type);

    }
    public  Call bysearch(String club_name){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.bysearch(club_name);
    }

    public  Call ifcollect(String fan_id, String user_id)
    {
        ClubService clubService =retrofit.create(ClubService.class);
        return  clubService.ifcollect(fan_id,user_id);
    }

    public  Call iscollect(String fan_id, String user_id)
    {
        ClubService clubService =retrofit.create(ClubService.class);
        return  clubService.iscollect(fan_id,user_id);
    }
    public  Call decollect(String fan_id, String user_id)
    {
        ClubService clubService =retrofit.create(ClubService.class);
        return  clubService.decollect(fan_id,user_id);
    }




//    public  Call getVideoList(String id, String type)
//    {
//        ClubService clubService = retrofit.create(ClubService.class);
//        return clubService.getVideoList(id, type);
//
//    }
}
